package com.appwoo.txtws.activity;

import android.app.ProgressDialog;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import com.appwoo.android.activity.BaseActivity;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.txtws.bean.ServerAppBean;
import com.appwoo.txtws.bean.UserInfoBean;
import com.appwoo.txtws.component.GetDateTime;
import com.appwoo.txtws.component.Global;
import com.appwoo.txtws.component.Logger;
import com.appwoo.txtws.component.RqSP;
import com.appwoo.txtws.service.UserInfoService;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParserException;

public class UserInfoShowActivity extends BaseActivity
  implements View.OnClickListener
{
  private String equipName = "";
  private UserInfoBean f_UserInfoBean = null;
  private ServerAppBean f_serverAppBean = null;
  private UserInfoService f_userInfoService = null;
  private String lgAccount = "";
  private TextView textview_userinfo_show_back;
  private ProgressDialog v_progressDialog = null;
  private TextView v_textview_package_book;
  private TextView v_textview_userinfo_edit_password;
  private TextView v_textview_userinfo_email;
  private TextView v_textview_userinfo_package;
  private TextView v_textview_userinfo_package_lf;
  private TextView v_textview_userinfo_phone;
  private TextView v_textview_userinfo_userName;
  private TextView v_textview_userpacklf;

  private void addListener()
  {
    this.textview_userinfo_show_back.setOnClickListener(this);
    this.v_textview_userinfo_edit_password.setOnClickListener(this);
    this.v_textview_package_book.setOnClickListener(this);
  }

  private String bgInitUserinfoBean()
  {
    try
    {
      this.f_UserInfoBean = this.f_userInfoService.getUserInfo(this.lgAccount, this.lgAccount, this);
      return "";
    }
    catch (IOException localIOException)
    {
      return getString(2131427525);
    }
    catch (XmlPullParserException localXmlPullParserException)
    {
      return getString(2131427525);
    }
    catch (TimeOutException localTimeOutException)
    {
      return getString(2131427525);
    }
    catch (NotFoundNetWorkException localNotFoundNetWorkException)
    {
      localNotFoundNetWorkException.getClass();
    }
    return "没有连接到网络";
  }

  private void bgShowUser(String paramString)
  {
    if (!paramString.equals(""))
      alertMessage(paramString);
    if (this.f_UserInfoBean != null)
    {
      this.v_textview_userinfo_userName.setText(this.lgAccount);
      this.v_textview_userinfo_phone.setText(this.f_UserInfoBean.getPhone());
      this.v_textview_userinfo_email.setText(this.f_UserInfoBean.getEmail());
      String str1 = this.f_UserInfoBean.getTaocan();
      String str2 = this.f_UserInfoBean.getDays();
      if ("A".equalsIgnoreCase(str1))
        this.v_textview_userinfo_package.setText(getString(2131428001));
      while (true)
      {
        if (str2 != null)
        {
          if (!str2.equals("包月"))
            break;
          this.v_textview_userpacklf.setText(getString(2131428003));
          this.v_textview_userinfo_package_lf.setText(str2);
        }
        return;
        if ("C".equalsIgnoreCase(str1))
          this.v_textview_userinfo_package.setText(getString(2131428002));
        else
          this.v_textview_userinfo_package.setText("");
      }
      try
      {
        String str3 = GetDateTime.getDate(GetDateTime.transDate(this.f_serverAppBean.getNowDate()), -1 + Integer.parseInt(str2));
        this.v_textview_userinfo_package_lf.setText(str3);
        return;
      }
      catch (Exception localException)
      {
        Logger.e("xjf", "UserInfoShowActivity Exception:" + localException.toString());
        return;
      }
    }
    alertMessage(getString(2131428004));
  }

  private void createOrShowDialog()
  {
    if ((this.v_progressDialog == null) || (!this.v_progressDialog.isShowing()))
    {
      this.v_progressDialog = new ProgressDialog(this);
      this.v_progressDialog.setMessage(getString(2131427516));
      this.v_progressDialog.setCancelable(true);
      this.v_progressDialog.show();
    }
  }

  private void initView()
  {
    this.f_userInfoService = new UserInfoService();
    this.f_serverAppBean = ((ServerAppBean)getApplication());
    this.textview_userinfo_show_back = ((TextView)findViewById(2131493620));
    this.v_textview_userinfo_edit_password = ((TextView)findViewById(2131493621));
    this.v_textview_userinfo_userName = ((TextView)findViewById(2131493623));
    this.v_textview_userinfo_phone = ((TextView)findViewById(2131493625));
    this.v_textview_userinfo_email = ((TextView)findViewById(2131493627));
    this.v_textview_userinfo_package = ((TextView)findViewById(2131493629));
    this.v_textview_package_book = ((TextView)findViewById(2131493630));
    this.v_textview_userinfo_package_lf = ((TextView)findViewById(2131493632));
    this.v_textview_userpacklf = ((TextView)findViewById(2131493631));
    this.equipName = getSharedPreferences("equipname", 0).getString("equipname", null);
    this.lgAccount = new RqSP().getLgAccount(this);
    if (Global.RightLimit == 0)
      this.v_textview_userinfo_edit_password.setVisibility(4);
  }

  private void showView()
  {
    new UserInfoAsyncTask().execute(new String[] { "init" });
  }

  public void onClick(View paramView)
  {
    if (paramView == this.textview_userinfo_show_back)
      backAcitvity(this);
    do
    {
      return;
      if (paramView == this.v_textview_userinfo_edit_password)
      {
        IntentActivity(this, UserInfoEditPasswordActivity.class);
        return;
      }
    }
    while (paramView != this.v_textview_package_book);
    IntentActivity(this, ServiceSenActivity.class);
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903225);
    initView();
    addListener();
    showView();
  }

  public class UserInfoAsyncTask extends AsyncTask<String, Integer, String>
  {
    private String method = "";

    public UserInfoAsyncTask()
    {
    }

    protected String doInBackground(String[] paramArrayOfString)
    {
      this.method = paramArrayOfString[0];
      if (this.method.equals("init"))
        return UserInfoShowActivity.this.bgInitUserinfoBean();
      return "";
    }

    protected void onPostExecute(String paramString)
    {
      if (this.method.equals("init"))
        UserInfoShowActivity.this.bgShowUser(paramString);
      UserInfoShowActivity.this.v_progressDialog.dismiss();
    }

    protected void onPreExecute()
    {
      UserInfoShowActivity.this.createOrShowDialog();
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.activity.UserInfoShowActivity
 * JD-Core Version:    0.6.2
 */